1. Field of the Invention
The present invention generally relates to data processing and, more particularly, to re-executing a query against a database for updating results of an initial query execution.
2. Description of the Related Art
Computerized information storage and retrieval systems made up of a (possibly large) number of files or tables are available in form of databases. The most prevalent type of database is the relational database, a tabular database in which data is defined so that it can be reorganized and accessed in a number of different ways.
Storing and retrieving data in a database or data warehouse is performed by means of a computer database management system (DBMS). A relational database management system (RDBMS) is a DBMS that uses relational techniques for storing and retrieving data. Regardless of the particular architecture, in a DBMS, a requesting entity (e.g., an application, the operating system or a user) demands access to a specified database or data warehouse by issuing a database access request. Such requests may include, for instance, simple catalog lookup requests or transactions and combinations of transactions that operate to read, change and add specified records in the database. These requests are made using high-level query languages such as the Structured Query Language (SQL).
Illustratively, SQL is used to make interactive queries for getting information from and updating a database such as International Business Machines' (IBM®) DB2®, Microsoft's SQL Server®, and database products from Oracle®, Sybase®, and Computer Associates®. The term “query” denominates a set of commands for retrieving and processing data from a stored database. Queries take the form of a command language that lets programmers and programs select, insert, update, find out the location of data, and so forth.
Assume a database including a table “DEMOGRAPHIC” having a plurality of data records, each data record comprising at least an indication of a last name, gender and age of a specific person. Assume further that a user wants to retrieve the last names of all male persons over the age of 40 from this table. To this end, the user would issue the following query against the database:                “select last_name from DEMOGRAPHIC where age>40 and gender=male”.This query includes three parts separated from each other using keywords. The first part includes the keyword “select” and designates the data to be extracted from retrieved data records, i.e., the “last_name”. The second part includes the keyword “from” and designates the table of the database to be selected for retrieving data, i.e., the table “DEMOGRAPHIC”. The third part includes the keyword “where” and comprises conditions defining properties of the data records to be retrieved, i.e., only data records relating to persons having an age “>40” and the gender “male”.        
One aspect of database environments, which complicates successful queries is that changes are continuously being made to the underlying data. Consequently, the result set of a given executed query may be different depending on when the query is executed. It would be desirable to ensure that, over time, new data that satisfies the query is also made available to the user who initially executed the query.
Assume a medical facility interested in conducting a specific research study. A plurality of groups within the medical facility may be involved in the specific research study to collect samples and other information to be used in the study. Typically, a coordinator of the specific research study sets up the study. To set up the study, the coordinator must coordinate the plurality of groups within the medical facility. Setting up the study further comprises finding a group of candidates that meet the criteria set forth by the study. This may involve complex queries against databases or data warehouses, which can be very expensive to run, as hours to days of execution time may be required to collect an initial list of possible candidates. Once this list is built, the coordinator must coordinate getting agreement from the possible candidates to participate in the study. This can be a long and difficult process extending over months for a number of reasons. For instance, due to laws protecting privacy simply calling possible candidates via telephone may be prohibited. Moreover, each possible candidate may not accept participation in the research study. In the event the coordinator can not gather sufficient candidates from the initially determined possible candidates for the specific research study, he is required to re-execute the queries against databases or data warehouses. Then the coordinator would need to identify new possible candidates from the newly produced search result.
However, re-executing complex queries and determining if any differences from an initial search result occur is generally problematic because of the huge amount of processing time required for the re-execution and the following identification of new relevant data records. Accordingly, there is a need for a more efficient and effective technique for re-executing a query against a database or a data warehouse.